
//应该采用静态包含
//alert(actJsonStr);
var GL_ActAry = '';
if(actJsonStr!=undefined && actJsonStr!=null && actJsonStr!=''){
    GL_ActAry = jQuery.parseJSON(actJsonStr);
    // console.log('GL_ActAry',GL_ActAry);
}

function userSLock(fnm){
    if(GL_ActAry==null || GL_ActAry==''){
        return false;
    }
    for(var i=0;i<GL_ActAry.length;i++){
        if(GL_ActAry[i].fnm==fnm)return true;
        if(GL_ActAry[i].fnm=='/') return true;
    }
    return false;
}

function userPLock(fnm){
    for(var i=0;i<GL_ActAry.length;i++){
        if(fnm.indexOf(GL_ActAry[i])==0 || GL_ActAry[i]==fnm){
            return true;
        }
    }
    return false;
}
function userCLock(fnm){
    for(var i=0;i<GL_ActAry.length;i++){
        if(GL_ActAry[i].indexOf(fnm)==0 || GL_ActAry[i]==fnm){
            return true;
        }
    }
    return false;
}
function userFLock(fnm){
    for(var i=0;i<GL_ActAry.length;i++){
        if(GL_ActAry[i].indexOf(fnm)==0 ||GL_ActAry[i].indexOf(fnm)==0 || GL_ActAry[i]==fnm){
            return true;
        }
    }
    return false;
}

function openLock(mu){
    var actKey = mu.getAttribute('userKey');
    if(mu.className.indexOf('userSLock')>=0){
        if(userSLock(actKey)){
            showOne(mu);
        }
    }else if(mu.className.indexOf('userPLock')>=0){
        if(userPLock(actKey)){
            showOne(mu);
        }
    }else if(mu.className.indexOf('userFLock')>=0){
        if(userFLock(actKey)){
            showOne(mu);
        }
    }else if(mu.className.indexOf('userCLock')>=0){
        if(userCLock(actKey)){
            showOne(mu);
        }
    }
}

function showOne(mu){
    //$('#'+mu.id).removeClass("userSLock");
    //$('#'+mu.id).addClass('userUnLock');
    //mu.css("background-color");

    mu.style.display="block";
}

function showActMenu(){
    var allActMenu = $(".userFLock,.userPLock,.userSLock,.userCLock");
    for(var i=0;i<allActMenu.length;i++){
        var mu = allActMenu[i];
        openLock(mu);
    }
}
$(function(){
    showActMenu();
});